//
//  BasicHttpService.h
//  WebServices
//
//  Created by psvn047 on 5/10/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "JSONKit.h"
#import "Application.h"
#import "Session.h"

@protocol ServiceCallbackDelegate;
@interface BasicHttpService : NSObject <NSURLConnectionDelegate>
{
      id<ServiceCallbackDelegate>   serviceCallbackDelegate;
      NSMutableData *responseData;
      NSString * serviceID;
      int statusCode;
}

@property(nonatomic, retain) id<ServiceCallbackDelegate>  serviceCallbackDelegate;
@property (retain, nonatomic) NSMutableData *responseData;
@property (retain, nonatomic)   NSString * serviceID;
-(void) callService:(NSString*) serviceId httpMethod:(NSString*) httpMethod httpHost: (NSString*) httpHost path:(NSString*) path queryParameters: (NSMutableDictionary*) queryParameters messageBody:(NSString*) messageBody application: (Application*) application session:(Session*) session; 

-(void) callServiceSuccessed:(NSString*) serviceId reponseData:(NSObject*) data;
-(void) callserviceFailed:(NSString*) serviceId reponseData:(NSObject*) data;
-(NSString*) getHTTPHost;
-(Application*) getApplication;
+(void) setSession:(Session*) sessionObj;
+(Session*) getSession;
@end

@protocol ServiceCallbackDelegate <NSObject>
- (void)successedCallback:(NSString*) serviceId reponseData:(NSObject*) data;
- (void)failedCallback:(NSString*) serviceId reponseData:(NSObject*) data;
@end